subroutine r1ai_t1fn_inafi_io(r1, t1, & 
               icore, fact)
!
use mod_size
use mod_ioff
use mod_iop
use mod_orbit
implicit none
!
real*8, intent(in) :: fact
real*4, intent(in) :: r1(*)
!
real*4, intent(inout) :: t1(*), icore(*)
!
integer :: i, j, a, b, nsize, nsizeaa, nsizebb
integer :: i0, i1, i2, i3
integer, external :: irpdso
real*8, external :: dnrm2, nrm2so
character*8 file1, file2, file3, file4, file5, file6
!this is to do r1(ai) = r1(ai) + t1(f,n)<na||fi>
!one should note that <na||fi> are sort as (fn,ai)
i0 = 1
i1 = i0 + nvvoo*isd
if(prec==4) then 
   file1 = 'BIAJAAAS'
   file2 = 'BIAJABAS'
   file3 = 'BIAJBBBS'
   file4 = 'BIAJBABS'
   file5 = 'BIAJAABS'
elseif(prec==8) then 
   file1 = 'BIAJAAAA'
   file2 = 'BIAJABAB'
   file3 = 'BIAJBBBB'
   file4 = 'BIAJBABA'
   file5 = 'BIAJAABB'
endif

!==AA
call getallso(icore, 1, file1) 
call VmnpqVmnrs_to_Vpqrs(icore, t1(ifvo(1)), 1, 1, vrta, popa, 1, &
             vrta, popa, 1, zorb, zorb, 1, r1(ifvo(1)), 1, fact, 1.d0)
call getallso(icore, 1, file5)
call itranspso(icore, icore(i1), vrta, popa, 1, vrtb, popb, 1, 1)
call VmnpqVmnrs_to_Vpqrs(icore(i1), t1(ifvo(2)), 1, 1, vrtb, popb, 1, &
             vrta, popa, 1, zorb, zorb, 1, r1(ifvo(1)), 1, fact, 1.d0)
!==BB
call VmnpqVmnrs_to_Vpqrs(icore(i0), t1(ifvo(1)), 1, 1, vrta, popa, 1, &
             vrtb, popb, 1, zorb, zorb, 1, r1(ifvo(2)), 1, fact, 1.d0)
call getallso(icore, 1, file3)
call VmnpqVmnrs_to_Vpqrs(icore, t1(ifvo(2)), 1, 1, vrtb, popb, 1, &
             vrtb, popb, 1, zorb, zorb, 1, r1(ifvo(2)), 1, fact, 1.d0)
return
end
